// BitInt.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
	int n1[1000];
	int n2[1000];
	int result[1001];
	
	int temp=0,i;

	for(int i=0;i<15;i++)
		scanf("%d", &n1[i]);

	for(int i=0;i<15;i++)
		scanf("%d", &n2[i]);

	for(i=14;i>=0;i--)
	{
		result[i+1] = n1[i] + n2[i] + temp;
		if(result[i+1]>9)
		{
			result[i+1] = result[i+1] -10;
			temp = 1;
		}
		else
			temp =0;

	}

	if(temp ==1)
		result[0] = 1;
	else result[0] = 0;

	for(i=0;i<16;i++)
		printf("%d ", result[i]);

	getchar();
	return 0;
}

